.app {
  .main-container {
    position: relative;
    min-height: 100%;
    margin-left: $sideBarWidth;
    transition: margin-left 0.28s;
  }

  .sidebar-container {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    width: $sideBarWidth !important;
    // 减去底部播放器高度
    height: calc(100% - $footerHeight);
    overflow: hidden;
    background-color: $menuBg;
    transition: width 0.28s;
    // 重置 element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__wrap {
      border-right: 1px solid #eee;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0;
    }

    .el-scrollbar {
      height: 100%;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - $logoAndNavHeight);
      }
    }

    .is-horizontal {
      display: none;
    }

    .svg-icon {
      margin-right: 12px;
    }

    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }

    .el-menu {
      width: 100% !important;
      height: 100%;
      border: none;
    }

    // 鼠标移入菜单hover时
    .el-sub-menu__title {
      padding-right: 0;
      &:hover {
        background-color: $menuHover !important;
      }
    }

    // 选中菜单(不包含深层嵌套菜单)
    .el-menu-item.is-active {
      // background-color: rgba(233,134,134,.1);
      color: var(--el-color-primary);
      border-right: 4px solid var(--el-color-primary);
    }

    // 子菜单
    .is-active>.el-sub-menu__title {
      color: $subMenuActiveText !important;
    }

    // 深层嵌套路由活跃菜单样式
    & .nest-menu .el-sub-menu>.el-sub-menu__title,
    & .el-sub-menu .el-menu-item {
      min-width: $sideBarWidth !important;
      // background-color: $subMenuBg !important;
      &:hover {
        background-color: $subMenuHover !important;
      }
    }

    // 针对深层嵌套活跃菜单样式，只有当其处于选中状态时才生效
    & .nest-menu .el-sub-menu>.el-sub-menu__title,
    & .el-sub-menu:has(.is-active) .el-menu-item {
      // border-right: 4px solid var(--el-color-primary);
    }
  }

  .hideSidebar {
    .left-wrap {
      width: 54px;
    }
    .sidebar-container {
      width: $hideSideBarWidth !important;
      .header {
        .logo-wrap {
          width: $hideSideBarWidth !important;
          transition: transform 0.28s;
        }
      }
    }
    .sidebar-title {
      display: none;
    }
    // 当侧边栏折叠时选中菜单样式(不包含深层嵌套菜单)
    .el-menu-item.is-active {
      background-color: #fff !important;
      border-right: none !important;
    }
    .main-container {
      margin-left: 54px;
    }
    .el-sub-menu {
      overflow: hidden;
      &>.el-sub-menu__title {
        padding: 0 !important;
        display: block;

        .svg-icon {
          margin-left: 20px;
        }

        .sub-el-icon {
          margin-left: 19px;
        }

        .el-sub-menu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu--collapse {
      .el-sub-menu {
        &>.el-sub-menu__title {
          &>span {
            display: inline-block;
            width: 0;
            height: 0;
            overflow: hidden;
            visibility: hidden;
          }
        }
      }
    }
  }

  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $sideBarWidth !important;
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// 当菜单折叠时
.el-menu--vertical {
  &>.el-menu {
    .svg-icon {
      margin-right: 12px;
    }
    .sub-el-icon {
      margin-right: 12px;
      margin-left: -2px;
    }
  }

  .nest-menu .el-sub-menu>.el-sub-menu__title,
  .el-menu-item {
    &:hover {
      // you can use $subMenuHover
      background-color: $menuHover !important;
    }
  }

  // 子菜单太长时出现滚动条
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;
    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }
    &::-webkit-scrollbar {
      width: 6px;
    }
    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}